﻿<phone:PhoneApplicationPage 
    x:Class="Boxi.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:boxi="clr-namespace:Boxi"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
    <phone:PhoneApplicationPage.Resources>

    </phone:PhoneApplicationPage.Resources>
        <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{Binding Instance, Source={StaticResource PersistentSettingsDataSource}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="370"/>
            <RowDefinition Height="80"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="240"/>
            <ColumnDefinition Width="240"/>
        </Grid.ColumnDefinitions>
        <Button Background="{Binding Path=AccentBrush}" Foreground="{Binding Path=SecondaryAccentBrush}" BorderBrush="{Binding Path=SecondaryAccentBrush}" Grid.Row="1" FontSize="16" Grid.Column="1" x:Name="btnResetSettings" Click="btnResetSettings_Click" Content="Reset Settings" Visibility="Collapsed"></Button>
        <Button Background="{Binding Path=AccentBrush}" Foreground="{Binding Path=SecondaryAccentBrush}" BorderBrush="{Binding Path=SecondaryAccentBrush}" Grid.Row="2" FontSize="16" Grid.Column="1"  x:Name="btnResetGame" Click="btnResetGame_Click"  Content="Reset Game" Visibility="Collapsed"></Button>
        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.ColumnSpan="2" x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Michael Kappel, MCPD" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Settings" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
        <StackPanel Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="1" Orientation="Horizontal">
            <TextBlock VerticalAlignment="Center" Text="Sound:" Width="100"></TextBlock>
            <CheckBox  Click="cbxSound_Click" VerticalAlignment="Center" Height="70" x:Name="cbxSound" Foreground="Red" Background="{Binding Path=AccentBrush, Mode=OneWay}" IsChecked="{Binding Path=IsSoundEnabled, Mode=TwoWay}" />
        </StackPanel>
        <StackPanel Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="2" Orientation="Horizontal">
            <TextBlock VerticalAlignment="Center" Text="Vibration:" Width="100"></TextBlock>
            <CheckBox Click="cbxVibration_Click" VerticalAlignment="Center" Height="70" x:Name="cbxVibration" Foreground="Red"  Background="{Binding Path=AccentBrush}" IsChecked="{Binding Path=IsVibrationEnabled, Mode=TwoWay}" />
        </StackPanel>
        <TextBlock VerticalAlignment="Bottom" Grid.Column="0" Grid.Row="3" Text="Main Color:"></TextBlock>
        <ListBox  Margin="10,5,10,0"  Grid.Column="0" Grid.Row="4" x:Name="lbxPlayer1Color" SelectedItem="{Binding Path=AccentBrush, Mode=TwoWay}" SelectionChanged="lbxPlayer1Color_SelectionChanged">
       
        </ListBox>
        <TextBlock VerticalAlignment="Bottom" Grid.Column="1" Grid.Row="3" Text="Secondary Color:"></TextBlock>
        <ListBox  Margin="10,5,10,0" Grid.Column="1" Grid.Row="4"  x:Name="lbxPlayer2Color"  SelectedItem="{Binding Path=SecondaryAccentColor, Mode=TwoWay}" SelectionChanged="lbxPlayer2Color_SelectionChanged">
        
        </ListBox>
        <Button Background="{Binding Path=AccentBrush}" Foreground="{Binding Path=SecondaryAccentBrush}" BorderBrush="{Binding Path=SecondaryAccentBrush}" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2" Margin="0,20,0,0" x:Name="btnStartGame" FontSize="16" Canvas.ZIndex="1100" Content="Back to Game" Click="btnStartGame_Click"></Button>
    </Grid>
        
</phone:PhoneApplicationPage>
